<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<link type="text/css" rel="stylesheet"
	href="ext/resources/css/ext-all.css">
<link type="text/css" rel="stylesheet"
	href="ext/resources/css/xtheme-gray.css">
<script type="text/javascript" src="ext/adapter/ext/ext-base.js">
</script>
<script type="text/javascript" src="ext/ext-all.js">
</script>
<script type="text/javascript" src="js/box.js">
</script>
<script type="text/javascript" src="/BBSPro/dwr/engine.js">
</script>
<script type="text/javascript" src="/BBSPro/dwr/util.js">
</script>
<script type="text/javascript"
	src="/BBSPro/dwr/interface/userServiceImpl.js">
</script>
<script type="text/javascript">
function login() {
	var userName = document.getElementById("userName").value;
	var password = document.getElementById("password").value;
	userServiceImpl.loginUser(userName, password, callBackLogin);
}
function callBackLogin(date) {
	if (date != "fail") {
		document.getElementById("headerBeforeLogin").style.display = "none";
		document.getElementById("headerAferLogin").style.display = "inline";
		var userInfo = date.split(" ")
		document.getElementById("headerAferLogin1").innerHTML = "<a href='blogIndex.jsp?userId="
				+ userInfo[0]
				+ "'><img src='files/"
				+ userInfo[1]
				+ "'style='width: 48px; height: 48px;' /></a>";
	}
}
</script>

<!-- 头部HTML样式 -->
<div id="header">
	<div id="headerTop">
		<div id="headerTopLeft">
			<a><img src="images/logo.png" /> </a>
		</div>
		<div id="headerTopRight">
			<!-- 登陆前右边样式 -->
			<div id="headerBeforeLogin">
				<div id="headerTopRightLeft">
					<div class="headerTopRightLeft1">
						<span class="headerTopRightLeft1-1"><a href="#">用户名</a> </span>
						<span class="headerTopRightLeft1-2"
							style="background: url('images/dotDown.gif')"></span>
						<span class="headerTopRightLeft1-3"><input type="text"
								style="text-align: left; width: 120px; height: 20px;"
								name="userName" id="userName"> </span>
						<span class="headerTopRightLeft1-4"> <span
							class="headerTopRightLeft1-4-1"><input type="radio"
									style="width: 15px; height: 15px" /> </span> <span
							class="headerTopRightLeft1-4-2">记住密码</span> </span>
					</div>
					<div class="headerTopRightLeft1">
						<span class="headerTopRightLeft1-1">密码</span>
						<span class="headerTopRightLeft1-2"></span>
						<span class="headerTopRightLeft1-3"><input type="password"
								style="text-align: left; width: 120px; height: 20px;"
								name="password" id="password"> </span>
						<span class="headerTopRightLeft1-4"> <span
							class="headerTopRightLeft1-4-1"><input type="button"
									value="登录" onclick="login()" /> </span> </span>
					</div>
				</div>
				<div class="headerTopRightSpilt"></div>
				<div class="headerTopRightRight">
					<span class="headerTopRightRight1"><a id="registerBtn">注册</a>
					</span>
					<span class="headerTopRightRight1"><a href="#">找回密码</a> </span>
				</div>
			</div>
			<!-- 登陆后右边样式 （先隐藏）-->
			<div id="headerAferLogin" style="display: none;">
				<div id="headerAferLogin1">
					<a href="lookBlogIndexAction?userId=${session.user.userId}"><img
							src="files/${session.user.userInfo.images }"
							style="width: 48px; height: 48px;" /> </a>
				</div>

				<div id="headerAferLogin2">
					<span><img src="images/people_mini.gif" style="border: 0px;" />
					</span>
					<span class="headerAferLogin2-0"><a
						href="lookBlogIndexAction?userId=${session.user.userId}">${session.user.userName
							}</a> </span>
					<span class="headerAferLogin2-1">|</span>
					<span><a
						href="getUserBlogRight?userId=${session.user.userId}">设置</a> </span>
					<span class="headerAferLogin2-1">|</span>
					<span><a
						href="lookMailAction_lookAllMails?userId=${session.user.userId}">消息</a>
					</span>
					<span class="headerAferLogin2-1">|</span>
					<span><a href="exitUserAction">退出</a> </span>
				</div>
			</div>
			<s:if test="#session.user!=null">
				<script>
document.getElementById("headerBeforeLogin").style.display = "none";
document.getElementById("headerAferLogin").style.display = "inline";
</script>
			</s:if>
		</div>
	</div>
	<div id="headerMenu">
		<ul>

			<li>
				<a href="index">首页</a>
			</li>

			<li>
				<a
					href="boardDisplayAction_lookOnlyBoardDetails?boardId=1&pageNo=1">Java</a>
			</li>
			<li>
				<a
					href="boardDisplayAction_lookOnlyBoardDetails?boardId=4&pageNo=1">前端技术</a>
			</li>
			<li>
				<a
					href="boardDisplayAction_lookOnlyBoardDetails?boardId=6&pageNo=1">数据库</a>
			</li>
			<li>
				<a
					href="boardDisplayAction_lookOnlyBoardDetails?boardId=8&pageNo=1">框架篇章</a>
			</li>
			<li>
				<a
					href="boardDisplayAction_lookOnlyBoardDetails?boardId=11&pageNo=1">闲聊</a>
			</li>
		</ul>
	</div>
</div>